VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MsComCtl.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmARTripTicket 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   7875
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   11355
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   7875
   ScaleWidth      =   11355
   ShowInTaskbar   =   0   'False
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   285
      Left            =   0
      TabIndex        =   0
      Top             =   7590
      Width           =   11355
      _ExtentX        =   20029
      _ExtentY        =   503
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Bevel           =   0
            Object.Width           =   6802
            MinWidth        =   2
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin ITGControls.ITGTab SSTab1 
      Height          =   4995
      Left            =   0
      TabIndex        =   28
      Top             =   0
      Width           =   11220
      _ExtentX        =   19791
      _ExtentY        =   8811
      TabCount        =   2
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   19
      Tab(0)ContCtrlCap(1)=   "ITGTextBox6"
      Tab(0)ContCtrlCap(2)=   "ITGTextBox5"
      Tab(0)ContCtrlCap(3)=   "ITGTextBox4"
      Tab(0)ContCtrlCap(4)=   "ITGTextBox3"
      Tab(0)ContCtrlCap(5)=   "ITGTextBox2"
      Tab(0)ContCtrlCap(6)=   "ITGTextBox1"
      Tab(0)ContCtrlCap(7)=   "txtTotalProduct"
      Tab(0)ContCtrlCap(8)=   "txtTotalCase"
      Tab(0)ContCtrlCap(9)=   "txtTotalCustomer"
      Tab(0)ContCtrlCap(10)=   "txtVanCapacity"
      Tab(0)ContCtrlCap(11)=   "txtNetweight"
      Tab(0)ContCtrlCap(12)=   "txtTareWeight"
      Tab(0)ContCtrlCap(13)=   "txtGrossWeight"
      Tab(0)ContCtrlCap(14)=   "Command1"
      Tab(0)ContCtrlCap(15)=   "Command2"
      Tab(0)ContCtrlCap(16)=   "Command3"
      Tab(0)ContCtrlCap(17)=   "Command4"
      Tab(0)ContCtrlCap(18)=   "Command5"
      Tab(0)ContCtrlCap(19)=   "ComunionFrames1"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      InActiveTabForeColor=   -2147483639
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483630
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   4680
         Left            =   -75000
         TabIndex        =   40
         Top             =   315
         Width           =   11220
         _ExtentX        =   19791
         _ExtentY        =   8255
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   7
         BeginProperty Column00 
            DataField       =   "cTranNo"
            Caption         =   "Transaction No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "dDate"
            Caption         =   "Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "dDeliveryDate"
            Caption         =   "Delivery Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cArea"
            Caption         =   "Area"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "cVanNo"
            Caption         =   "Van No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "cDriver"
            Caption         =   "Driver"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column06 
            DataField       =   "cRemarks"
            Caption         =   "Remarks"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               Locked          =   -1  'True
               ColumnWidth     =   1379.906
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   1260.284
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   1379.906
            EndProperty
            BeginProperty Column03 
               Locked          =   -1  'True
            EndProperty
            BeginProperty Column04 
               Locked          =   -1  'True
               ColumnWidth     =   1335.118
            EndProperty
            BeginProperty Column05 
               Locked          =   -1  'True
               ColumnWidth     =   1289.764
            EndProperty
            BeginProperty Column06 
               Locked          =   -1  'True
               ColumnWidth     =   2610.142
            EndProperty
         EndProperty
      End
      Begin ITGControls.ITGTextBox ITGTextBox6 
         Height          =   285
         Left            =   2490
         TabIndex        =   39
         Top             =   3960
         Width           =   2865
         _ExtentX        =   4948
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2805
      End
      Begin ITGControls.ITGTextBox ITGTextBox5 
         Height          =   285
         Left            =   120
         TabIndex        =   21
         Top             =   3960
         Width           =   2010
         _ExtentX        =   3334
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   "Helper 3"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   800
         TextBoxWidth    =   1150
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox ITGTextBox4 
         Height          =   285
         Left            =   2490
         TabIndex        =   38
         Top             =   3645
         Width           =   2865
         _ExtentX        =   4948
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2805
      End
      Begin ITGControls.ITGTextBox ITGTextBox3 
         Height          =   285
         Left            =   120
         TabIndex        =   19
         Top             =   3645
         Width           =   2010
         _ExtentX        =   3334
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   "Helper 2"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   800
         TextBoxWidth    =   1150
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox ITGTextBox2 
         Height          =   285
         Left            =   2490
         TabIndex        =   37
         Top             =   3330
         Width           =   2865
         _ExtentX        =   4948
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2805
      End
      Begin ITGControls.ITGTextBox ITGTextBox1 
         Height          =   285
         Left            =   120
         TabIndex        =   17
         Top             =   3330
         Width           =   2010
         _ExtentX        =   3334
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14745599
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   "Helper 1"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   800
         TextBoxWidth    =   1150
         Required        =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtTotalProduct 
         Height          =   285
         Left            =   8385
         TabIndex        =   36
         Top             =   3960
         Width           =   2520
         _ExtentX        =   4233
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         Locked          =   -1  'True
         Label           =   "No of Products"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1060
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtTotalCase 
         Height          =   285
         Left            =   8385
         TabIndex        =   35
         Top             =   3330
         Width           =   2520
         _ExtentX        =   4233
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         Locked          =   -1  'True
         Label           =   "No of Case"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1060
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtTotalCustomer 
         Height          =   285
         Left            =   8385
         TabIndex        =   34
         Top             =   3645
         Width           =   2520
         _ExtentX        =   4233
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         Locked          =   -1  'True
         Label           =   "No of Customer"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1060
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtVanCapacity 
         Height          =   285
         Left            =   5670
         TabIndex        =   26
         Top             =   4275
         Width           =   2535
         _ExtentX        =   4260
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Van Capacity"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1075
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtNetweight 
         Height          =   285
         Left            =   5670
         TabIndex        =   33
         Top             =   3960
         Width           =   2535
         _ExtentX        =   4260
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Locked          =   -1  'True
         Label           =   "Net Weight"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1075
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtTareWeight 
         Height          =   285
         Left            =   5670
         TabIndex        =   25
         Top             =   3645
         Width           =   2535
         _ExtentX        =   4260
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Tare Weight"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1075
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtGrossWeight 
         Height          =   285
         Left            =   5670
         TabIndex        =   32
         Top             =   3330
         Width           =   2535
         _ExtentX        =   4260
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Locked          =   -1  'True
         Label           =   "Gross Weight"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1400
         TextBoxWidth    =   1075
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin VB.CommandButton Command1 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   2160
         Picture         =   "frmARTripTicket.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   18
         Top             =   3330
         Width           =   315
      End
      Begin VB.CommandButton Command2 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   2160
         Picture         =   "frmARTripTicket.frx":014A
         Style           =   1  'Graphical
         TabIndex        =   20
         Top             =   3645
         Width           =   315
      End
      Begin VB.CommandButton Command3 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   2160
         Picture         =   "frmARTripTicket.frx":0294
         Style           =   1  'Graphical
         TabIndex        =   22
         Top             =   3960
         Width           =   315
      End
      Begin VB.CommandButton Command4 
         Caption         =   "<<< Expenses >>>"
         Height          =   330
         Left            =   150
         TabIndex        =   23
         Top             =   4350
         Width           =   2325
      End
      Begin VB.CommandButton Command5 
         Caption         =   "Schedule of Deliveries"
         Height          =   330
         Left            =   2535
         TabIndex        =   24
         Top             =   4350
         Width           =   2340
      End
      Begin ITGControls.ComunionFrames ComunionFrames1 
         Height          =   2775
         Left            =   0
         Top             =   315
         Width           =   11220
         _ExtentX        =   19791
         _ExtentY        =   4895
         FrameColor      =   4210752
         BackColor       =   16243138
         FillColor       =   16243138
         RoundedCorner   =   0   'False
         Caption         =   "Trip Ticket Information"
         Alignment       =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ThemeColor      =   5
         ColorFrom       =   16243138
         ColorTo         =   16250865
         Begin VB.Timer Timer1 
            Interval        =   300
            Left            =   3780
            Top             =   555
         End
         Begin VB.CommandButton cmdPickCode 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   3315
            Picture         =   "frmARTripTicket.frx":03DE
            Style           =   1  'Graphical
            TabIndex        =   6
            Top             =   1275
            Width           =   315
         End
         Begin VB.Frame Frame2 
            Appearance      =   0  'Flat
            BackColor       =   &H00F7D9C2&
            ForeColor       =   &H80000008&
            Height          =   2010
            Left            =   7485
            TabIndex        =   27
            Top             =   525
            Width           =   3570
            Begin ITGControls.ITGTextBox txtAmount 
               Height          =   285
               Left            =   135
               TabIndex        =   13
               Top             =   570
               Width           =   3210
               _ExtentX        =   5450
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               DecimalPlace    =   2
               Label           =   "Amount"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               TextBoxWidth    =   1650
               LinkForeColor   =   0
            End
            Begin ITGControls.ITGTextBox txtTime 
               Height          =   285
               Left            =   135
               TabIndex        =   14
               Top             =   885
               Width           =   3210
               _ExtentX        =   5450
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Label           =   "Time"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               TextBoxWidth    =   1650
               LinkForeColor   =   0
            End
            Begin ITGControls.ITGTextBox txtGasStation 
               Height          =   285
               Left            =   135
               TabIndex        =   15
               Top             =   1200
               Width           =   3210
               _ExtentX        =   5450
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Label           =   "Gas Station"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               TextBoxWidth    =   1650
               LinkForeColor   =   0
            End
            Begin ITGControls.ITGTextBox txtOdometer 
               Height          =   285
               Left            =   135
               TabIndex        =   16
               Top             =   1515
               Width           =   3210
               _ExtentX        =   5450
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               Label           =   "Odometer Reading"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               TextBoxWidth    =   1650
               LinkForeColor   =   0
            End
            Begin ITGControls.ITGTextBox txtFuel 
               Height          =   285
               Left            =   135
               TabIndex        =   12
               Top             =   255
               Width           =   3210
               _ExtentX        =   5450
               _ExtentY        =   503
               SendKeysTab     =   -1  'True
               LabelBackColor  =   16243138
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Text            =   "0"
               DataType        =   1
               Label           =   "Fuel Refill"
               BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               TextBoxWidth    =   1650
               LinkForeColor   =   0
            End
         End
         Begin VB.CommandButton cmdPickEmp 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   3315
            Picture         =   "frmARTripTicket.frx":0528
            Style           =   1  'Graphical
            TabIndex        =   9
            Top             =   1590
            Width           =   315
         End
         Begin ITGControls.ITGTextBox txtTranNo 
            Height          =   285
            Left            =   135
            TabIndex        =   1
            Top             =   645
            Width           =   3135
            _ExtentX        =   5318
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Transaction No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   1775
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtVanNo 
            Height          =   285
            Left            =   135
            TabIndex        =   5
            Top             =   1275
            Width           =   3150
            _ExtentX        =   5345
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Van No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   1790
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtDriver 
            Height          =   285
            Left            =   135
            TabIndex        =   8
            Top             =   1590
            Width           =   3150
            _ExtentX        =   5345
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Driver"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   1790
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtArea 
            Height          =   285
            Left            =   135
            TabIndex        =   3
            Top             =   960
            Width           =   3150
            _ExtentX        =   5345
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Area Code"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   1790
            Required        =   -1  'True
         End
         Begin ITGControls.ITGDateBox dtbDelivery 
            Height          =   285
            Left            =   5415
            TabIndex        =   4
            Top             =   960
            Width           =   1395
            _ExtentX        =   2461
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtRemarks 
            Height          =   285
            Left            =   135
            TabIndex        =   11
            Top             =   2220
            Width           =   6675
            _ExtentX        =   11562
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   5315
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtPlateNo 
            Height          =   285
            Left            =   4200
            TabIndex        =   7
            Top             =   1275
            Width           =   2610
            _ExtentX        =   4392
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Plate No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1180
            TextBoxWidth    =   1370
         End
         Begin ITGControls.ITGTextBox txtDriverName 
            Height          =   285
            Left            =   3645
            TabIndex        =   30
            Top             =   1590
            Width           =   3165
            _ExtentX        =   5477
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   ""
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3105
         End
         Begin ITGControls.ITGTextBox txtAllowance 
            Height          =   285
            Left            =   135
            TabIndex        =   10
            Top             =   1905
            Width           =   3150
            _ExtentX        =   5345
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            Mandatory       =   -1  'True
            DecimalPlace    =   2
            Label           =   "Allowance"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1300
            TextBoxWidth    =   1790
            Required        =   -1  'True
         End
         Begin ITGControls.ITGDateBox dtbDate 
            Height          =   285
            Left            =   5415
            TabIndex        =   2
            Top             =   645
            Width           =   1395
            _ExtentX        =   2461
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
         End
         Begin VB.Label Label2 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Delivery Date"
            Height          =   195
            Left            =   4245
            TabIndex        =   31
            Top             =   960
            Width           =   975
         End
         Begin VB.Label Label1 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Date"
            Height          =   195
            Left            =   4260
            TabIndex        =   29
            Top             =   705
            Width           =   345
         End
      End
   End
   Begin ITGControls.ComunionFrames ComunionFrames2 
      Height          =   2190
      Left            =   0
      Top             =   4980
      Width           =   11220
      _ExtentX        =   19791
      _ExtentY        =   3863
      FrameColor      =   4210752
      BackColor       =   16243138
      FillColor       =   16243138
      RoundedCorner   =   0   'False
      Caption         =   "Details"
      Alignment       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ThemeColor      =   5
      ColorFrom       =   16243138
      ColorTo         =   16250865
      Begin VB.ComboBox cboTripTicket 
         Height          =   315
         ItemData        =   "frmARTripTicket.frx":0672
         Left            =   7725
         List            =   "frmARTripTicket.frx":068B
         Style           =   2  'Dropdown List
         TabIndex        =   41
         Top             =   600
         Visible         =   0   'False
         Width           =   2760
      End
      Begin MSDataGridLib.DataGrid dtgTripTicket 
         Height          =   1770
         Left            =   0
         TabIndex        =   42
         Top             =   420
         Width           =   11220
         _ExtentX        =   19791
         _ExtentY        =   3122
         _Version        =   393216
         AllowArrows     =   -1  'True
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         WrapCellPointer =   -1  'True
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   10
         BeginProperty Column00 
            DataField       =   "cDRNo"
            Caption         =   "DR No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cSONo"
            Caption         =   "SO No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cCustomer"
            Caption         =   "Customer"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cAddress"
            Caption         =   "Address"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "cTerms"
            Caption         =   "Terms"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "lDelivered"
            Caption         =   "Delivered"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   5
               Format          =   ""
               HaveTrueFalseNull=   1
               TrueValue       =   "Y"
               FalseValue      =   "N"
               NullValue       =   "N"
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   7
            EndProperty
         EndProperty
         BeginProperty Column06 
            DataField       =   "cRemarks"
            Caption         =   "Remarks"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column07 
            DataField       =   "nKMR"
            Caption         =   "KM Reading"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column08 
            DataField       =   "cArrive"
            Caption         =   "Arrival"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column09 
            DataField       =   "cDeparture"
            Caption         =   "Departure"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               Button          =   -1  'True
               ColumnWidth     =   989.858
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   1019.906
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   3600
            EndProperty
            BeginProperty Column03 
               Locked          =   -1  'True
               Object.Visible         =   0   'False
               ColumnWidth     =   3704.882
            EndProperty
            BeginProperty Column04 
               Locked          =   -1  'True
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column05 
               Alignment       =   2
               ColumnWidth     =   854.929
            EndProperty
            BeginProperty Column06 
               Button          =   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   2805.166
            EndProperty
            BeginProperty Column07 
               ColumnWidth     =   1365.165
            EndProperty
            BeginProperty Column08 
            EndProperty
            BeginProperty Column09 
            EndProperty
         EndProperty
      End
   End
End
Attribute VB_Name = "frmARTripTicket"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IT Group Inc. 2005.09.23

Option Explicit

'Object variables
Private oPrint As New clsPrinting

'Recordset variables
Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1
Private rsDetail As ADODB.Recordset

'ADO Connection variables

Private connHeader As ADODB.Connection
Private connDetail As ADODB.Connection

'Form mode enumeration
Enum eTripTicket
    Normal
    AddNewEdit
    Find
End Enum
Public Mode As eTripTicket

'Other declarations
Public dtgName As String
Public sBit As String
Private vBM As Variant 'Recordset bookmark variable

'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cboTripTicket_Click()
    rsDetail!cRemarks = cboTripTicket
End Sub

Private Sub cboTripTicket_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgTripTicket.Col = 6 Then
            rsDetail!cRemarks = cboTripTicket
            cboTripTicket.Visible = False
            dtgTripTicket.Col = 6
            dtgTripTicket.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboTripTicket.Visible = False
    End If
End Sub

Private Sub cboTripTicket_LostFocus()
    cboTripTicket.Visible = False
End Sub

Private Sub cmdPickCode_Click()
    If lPickListActive Then Exit Sub
    frmITGPickList.mType = Asset
    frmITGPickList.Show vbModal
    txtVanNo = frmITGPickList.mCode
    If Trim(txtVanNo) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub cmdPickEmp_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtDriver)
    frmITGPicker.zType = QEmployeeDriver
    frmITGPicker.Show vbModal
    txtDriver = frmITGPicker.zCode
    txtDriverName = frmITGPicker.zName
    If Trim(txtDriverName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub dtgTripTicket_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case Else
    End Select
End Sub

Private Sub dtgTripTicket_ButtonClick(ByVal ColIndex As Integer)

    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 0
            If lPickListActive Then Exit Sub
            frmITGPickList.mType = DeliveryReceipt
            frmITGPickList.Show vbModal
            If Trim(frmITGPickList.mCode) = "" Then Exit Sub
            dtgTripTicket.Columns(0).Value = frmITGPickList.mCode & ""
            dtgTripTicket.Columns(1).Value = frmITGPickList.mName & ""
            dtgTripTicket.Columns(2).Value = frmITGPickList.mRefNo & ""
            dtgTripTicket.Columns(3).Value = frmITGPickList.mUnit & ""
            dtgTripTicket.Columns(4).Value = frmITGPickList.mParam & ""
            dtgTripTicket.Columns(6).Value = "" 'cboTripTicket.List(0)
            dtgTripTicket.Col = 5
            dtgTripTicket.Columns(5).Value = False
            CheckDoubleDetails rsDetail!cDRNo
            ComputeWeight
        Case 6
            Call MoveCombo(cboTripTicket, dtgTripTicket, dtgTripTicket.Columns(6))
            cboTripTicket.Text = "Not Ordered"
            rsDetail!cRemarks = cboTripTicket
    End Select

End Sub

'Set the datagrid as active control
Private Sub dtgTripTicket_Click()
    If Mode = AddNewEdit Then dtgName = dtgTripTicket.Name
End Sub

Private Sub dtgTripTicket_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgTripTicket_GotFocus()
    dtgName = dtgTripTicket.Name
End Sub

Private Sub dtgTripTicket_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgTripTicket_KeyPress(KeyAscii As Integer)
    
    If Mode <> AddNewEdit Then Exit Sub
    If rsDetail.RecordCount = 0 Then Exit Sub
    
    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
    
    If KeyAscii = 13 Then
        Select Case dtgTripTicket.Col
            Case 0
                sSQL = "SELECT DISTINCT(A.cDRNo), B.cSONo, C.cName AS cCode, B.cAddress, B.cTerm, D.cTranNo " & _
                    "FROM DR_T A " & _
                    "LEFT OUTER JOIN SO B ON A.cRefNo = B.cSONo AND A.cCompanyID = B.cCompanyID " & _
                    "LEFT OUTER JOIN CLIENT_CUSTOMER C ON B.cCode = C.cCode AND B.cCompanyID = C.cCompanyID " & _
                    "LEFT OUTER JOIN TRIPTICKET_T D ON A.cDRNo = D.cDRNo AND A.cRefNo = D.cSONo AND A.cCompanyID = D.cCompanyID " & _
                    "WHERE B.cSONo IS NOT NULL AND D.cTranno IS NULL AND A.cCompanyID = '" & COID & "' " & _
                    "AND A.cDRNo = '" & Trim(dtgTripTicket.Columns(0).Text) & "'"
                Set rs = New Recordset
                rs.Open sSQL, cn, adOpenKeyset
                If rs.RecordCount > 0 Then
                    dtgTripTicket.Columns(0).Value = rs!cDRNo
                    dtgTripTicket.Columns(1).Value = rs!cSONO
                    dtgTripTicket.Columns(2).Value = rs!cCode
                    dtgTripTicket.Columns(3).Value = rs!cAddress
                    dtgTripTicket.Columns(4).Value = rs!cTerm
                    dtgTripTicket.Columns(6).Value = cboTripTicket.List(0)
                    dtgTripTicket.Col = 5
                    dtgTripTicket.Columns(5).Value = False
                    CheckDoubleDetails rsDetail!cDRNo
                    ComputeWeight
                    rs.Close
                    Set rs = Nothing
                Else
                    rs.Close
                    Set rs = Nothing
                    dtgTripTicket_ButtonClick (0)
                End If
            Case 6
                dtgTripTicket_ButtonClick (6)
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii))) 'All Upper Case String
    End If

End Sub

'Right click menu popup
Private Sub dtgTripTicket_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgTripTicket.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
    SortGrid dtgList, ColIndex, rsHeader
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

'Set Your Object
Private Sub Form_Load()
    Set FrmName = Me
    FormSetup
    
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'LG01'")
    
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
    
    
    FormLocking True
    FormSearch True
    SearchObj True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True

    Mode = Find
    txtTranNo.Locked = False
    
 
End Sub

'Activate your Toolbar Mode
Private Sub Form_Activate()
    TBBitReload
End Sub

'Release your Object
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False

    
    
    
    
    Set oPrint = Nothing
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set connHeader = Nothing
    Set connDetail = Nothing
    
    Set frmARTripTicket = Nothing

    lCloseWindow = True
    
'    'oForm(Me.Tag).Mode = 1
'    'oForm(Me.Tag).Tag = Me.Tag
End Sub

'Add new record to the recordset
Public Sub TBNew()

    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtTranNo.BackColor = &HE0FFFF
    Mode = AddNewEdit

    If rsHeader.State <> adStateOpen Then
        OpenNewConnection connHeader
        OpenNewConnection connDetail
        OpenRecordsetWithCN rsDetail, "*", "TRIPTICKET_T", connDetail, "WHERE 1 = 0"
        OpenRecordsetWithCN rsHeader, "*", "TRIPTICKET", connHeader, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else
        vBM = rsHeader.Bookmark
    End If

    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    rsHeader!dDate = Date
    
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    SSTab1.ActiveTab = 0
    txtTranNo.SetFocus

End Sub

'Undo all changes to the recordset
Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent
    
    rsHeader.CancelBatch adAffectAll
    rsDetail.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
    
    Set FrmName = Me
    FormLocking True
    
    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, lACPrint, True
    Else
        RSZero
        Mode = Find
    End If

    sbRS.Panels(2) = ""
    
    SetDataSource
    SetDataField

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoAll
    End If

End Sub

'Undo changes on the current record
Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler

    GetChild
    If rsHeader.Status = adRecNew Then
        rsDetail.CancelBatch adAffectAll
        rsHeader.CancelUpdate
    Else
        rsHeader.CancelBatch adAffectCurrent
        rsDetail.CancelBatch adAffectAll
    End If
   
    If rsHeader.RecordCount = 0 Then RSZero
    
ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoCurrent
    End If

End Sub

'Save all changes
Public Sub TBSave()
Dim OKUpdate As Boolean
On Error GoTo ErrHandler

    'Audit Trail
    lBoolean = False
    
    If rsHeader.Status = adRecNew Then lBoolean = True
    
        
    If rsHeader.Status = adRecNew Then

    End If
    
    
    If Not MandatoryOK Then Exit Sub
    
    OKUpdate = False
    
    sSQL = "UPDATE DR SET dReceived = NULL WHERE cDRNo IN (SELECT cDRNo FROM TRIPTICKET_T WHERE cCompanyID = '" & COID & "' AND cTranNo = '" & Trim(txtTranNo) & "' ) "
    cn.Execute sSQL
    
    cn.BeginTrans
     
    If rsDetail.RecordCount <> 0 Then
        rsDetail.MoveFirst
        Do Until rsDetail.EOF
            If rsDetail!lDelivered = True Then
                sSQL = "UPDATE DR SET dReceived = '" & Trim(dtbDelivery.Text) & "' WHERE cDRNo = '" & Trim(rsDetail!cDRNo) & "' AND cCompanyID = '" & COID & "'"
                cn.Execute sSQL
            End If
            rsDetail.MoveNext
        Loop
    End If
    
    rsHeader.UpdateBatch adAffectAll
    rsDetail.UpdateBatch adAffectAll
    
    cn.CommitTrans
    OKUpdate = True
    
    Set FrmName = Me
    FormLocking True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, lACPrint, True
    Mode = Normal
    
    

    
    
    MsgBox "Record/s successfully saved.", vbInformation, "ComUnion"
    sbRS.Panels(2) = ""
    CountItemCustomer
    'Audit trail
    UpdateLogFile "Trip Ticket", Trim(txtTranNo), IIf(lBoolean, "Inserted", "Updated")
    

ErrHandler:
    cboTripTicket.Visible = False
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        MsgBox "Record cannot be updated. Some values may have been changed by other users since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, "ComUnion"
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        rsDetail.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, lACPrint, True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, "ComUnion"
        cn.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name 'Error log
    End If
    
End Sub

'Sets the form & recorset to add/edit mode
Public Sub TBEdit()
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtTranNo.Locked = True
    SSTab1.ActiveTab = 0
    dtbDate.SetFocus
    vBM = rsHeader.Bookmark
End Sub

'Delete record
Public Sub TBDelete()
On Error GoTo ErrorHandler

    sID = Trim(txtTranNo)
    
    If rsHeader.RecordCount = 0 Then Exit Sub

    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "ComUnion") = vbNo Then Exit Sub

    GetChild
    If rsDetail.RecordCount <> 0 Then
        rsDetail.MoveFirst
        Do Until rsDetail.RecordCount = 0
            '*** 05/24/2004 ***'
            sSQL = "UPDATE DR SET dReceived = NULL WHERE cDRNo = '" & Trim(rsDetail!cDRNo) & "' AND cCompanyID = '" & COID & "'"
            cn.Execute sSQL
            '*** 05/24/2004 ***'
            rsDetail.Delete adAffectCurrent
            If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
        Loop
    End If
    
    'Audit trail
    UpdateLogFile "Trip Ticket", Trim(txtTranNo), "Deleted"

    rsHeader.Delete adAffectCurrent
    
    rsDetail.UpdateBatch adAffectAll
    rsHeader.UpdateBatch adAffectAll

    
    
    TBPrevRec

    Mode = Normal

    If rsHeader.RecordCount = 0 Then
        RSZero
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Or err.Number = -2147217887 Then
        cn.Execute "DELETE TRIPTICKET_T WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE TRIPTICKET WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        Resume Next
    End If

End Sub

'Search using the frmITGSearch
Public Sub TBFind()
    Mode = Normal
    txtTranNo.Locked = True
    frmITGSearch.Show 'vbModal
End Sub

'Search using the recordset primary key
Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
        
    OpenNewConnection connHeader
    OpenNewConnection connDetail
    
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset

    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtTranNo.Locked = False
        txtTranNo.SetFocus
        Exit Sub
    End If
    
    OpenRecordsetWithCN rsHeader, "*", "TRIPTICKET", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
    'OpenRecordsetWithCN rsDetail, "*", "TRIPTICKET_T", connDetail
            
    OpenRecordsetWithCN rsDetail, "*", "TRIPTICKET_T", connDetail, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM TRIPTICKET WHERE " & sTemp & ")")
       
    Set FrmName = Me
    FormLocking True

    If rsHeader.RecordCount = 0 Then
        FormWaitHide
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        FormSearch True
        SearchObj True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtTranNo.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, lACPrint, True

    FormWaitHide
Else
    RSZero
    FormSearch True
    SearchObj True
    Mode = Find
    

   
   
End If

End Sub

'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
    dtgName = dtgTripTicket.Name
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Move first
Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader
    

End Sub

'Move previuos
Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader
    

End Sub

'Move next
Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader
    

End Sub

'Move last
Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader
    

End Sub

'Add new line to the detail recordset
Public Sub TBNewLine()
    
    If rsHeader!cTranNo = "" Then Exit Sub
    
    If dtgName = "dtgTripTicket" Then
        rsDetail.AddNew
        rsDetail!cCompanyID = COID
        rsDetail!cTranNo = Trim(rsHeader!cTranNo)
        dtgTripTicket.Col = 0
        dtgTripTicket.Columns(0).Value = ""
        GetChild
        If rsDetail.RecordCount <> 0 Then rsDetail.MoveLast
        txtVanNo.SetFocus
        dtgTripTicket.SetFocus
    End If
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True

End Sub

'Delete line in the detail recordset
Public Sub TBDeleteLine()
On Error GoTo ErrorHandler

    If dtgName = dtgTripTicket.Name Then
        If rsDetail.RecordCount = 0 Then Exit Sub
        vBookMark = dtgTripTicket.Bookmark
        GetChild
        dtgTripTicket.Bookmark = vBookMark
        rsDetail.Delete adAffectCurrent
        ComputeWeight
    End If
    GetChild

    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo All
Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

    MsgBox "Unavailable on " & Me.Name

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo current line
Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Post current record
Public Sub TBPostRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Cancel current record
Public Sub TBCancelRecord()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Print
Public Sub TBPrintRecord()
    cModule = "Trip_Ticket"
    oPrint.PrintReceipt Trim(txtTranNo)
End Sub

'Sets the data source of the controls
Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgList.DataSource = rsHeader
    Set dtgTripTicket.DataSource = rsDetail
    
    
   
End Sub

'Sets the data field for every bounded controls
Sub SetDataField()
    With rsHeader
        txtTranNo.DataField = !cTranNo
        dtbDate.DataField = !dDate
        dtbDelivery.DataField = !dDeliveryDate
        txtArea.DataField = !cArea
        txtVanNo.DataField = !cVanNo
        txtDriver.DataField = !cDriver
        txtRemarks.DataField = !cRemarks
        txtFuel.DataField = !nFuel
        txtAmount.DataField = !nAmount
        txtTime.DataField = !cTime
        txtGasStation.DataField = !cGas
        txtOdometer.DataField = !nOdometer
        txtGrossWeight.DataField = !nGrossWeight
        txtTareWeight.DataField = !nTare
        txtNetWeight.DataField = !nNetWeight
        txtVanCapacity.DataField = !nVan
        txtTotalCase.DataField = !nCase
        txtTotalCustomer.DataField = !nCustomer
        txtTotalProduct.DataField = !nProduct
        txtAllowance.DataField = !nAllowance
    End With
End Sub


Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler

    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        'Status bar setup
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount

        If rsHeader.Status <> adRecNew Then
            txtTranNo.Locked = True
        Else
            txtTranNo.Locked = False
        End If

        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else
            sbRS.Panels(2) = ""
        End If
        
        GetChild
    Else
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtTranNo.Locked = False
    End If

    If Mode = AddNewEdit Then
        dtgTripTicket.Refresh
    End If

ErrorHandler:
    'Err.Number -2147217885
    'Description - Row handle referred to a deleted row or a row marked for deletion.
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab1.TabEnabled(1) = False
    Else
        SSTab1.TabEnabled(1) = True
    End If
End Sub

Private Sub txtDriver_Change()
    txtDriverName = ""
    txtDriverName = GetValueFrTable("cEmpName", "EMPLOYEE", "cEmpCode = '" & Trim(txtDriver) & "'")
End Sub

Private Sub txtDriver_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtDriverName) = "" And Trim(txtDriver) <> "" Then cmdPickEmp_Click
End Sub

Private Sub txtRemarks_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If rsDetail.RecordCount = 0 Then TBNewLine
End Sub

Private Sub txtTranNo_LostFocus()
    'Does Code Already Exist
    If Mode = AddNewEdit Then
        If Trim(txtTranNo) = "" Then
            MsgBox "Empty primary input.", vbInformation, "ComUnion"
            If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
            txtTranNo.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtTranNo = Trim(txtTranNo)
            If IDExisting(rsHeader, "cTranNo", "TRIPTICKET", Trim(rsHeader!cTranNo)) Then
                MsgBox "Transaction No. already exist.", vbInformation, "ComUnion"
                If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
                txtTranNo.SetFocus
            End If
        End If
    End If
End Sub

Private Sub txtVanNo_Change()
    txtPlateNo = GetValueFrTable("cVehiclePlateNo", "ASSET", "cAssetNo = '" & Trim(txtVanNo) & "' and cType = 'Vehicle'")
    txtDriver = GetValueFrTable("cVehicleEmpCode", "ASSET", "cAssetNo = '" & Trim(txtVanNo) & "' and cType = 'Vehicle'")
End Sub

'Check if all mandatory fields are complete
Function MandatoryOK() As Boolean

    MandatoryOK = True

    If Trim(txtTranNo) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Transaction Number' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        txtTranNo.SetFocus
        Exit Function
    End If
    
    If rsHeader.Status = adRecNew Then
        If IDExisting(rsHeader, "cTranNo", "TRIPTICKET", Trim(rsHeader!cTranNo)) Then
            MandatoryOK = False
            MsgBox "Transaction No. already exist.", vbInformation, "ComUnion"
            txtTranNo.SetFocus
            Exit Function
        End If
    End If

    'Required fields
    If Trim(dtbDate.Text) = "__/__/____" Then
        MandatoryOK = False
        MsgBox "Field 'Transaction Date' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        dtbDate.SetFocus
        Exit Function
    ElseIf Trim(dtbDelivery.Text) = "__/__/____" Then
        MandatoryOK = False
        MsgBox "Field 'Delivery Date' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        dtbDelivery.SetFocus
        Exit Function
    ElseIf Trim(txtVanNo) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Van No.' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        txtVanNo.SetFocus
        Exit Function
    End If
    
    GetChild
    
    If rsHeader.Status = adRecNew Then
    'ElseIf Trim(txtFuel) = "" Then
    '    MandatoryOK = False
    '    MsgBox "Field 'Fuel Refill' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
    '    txtFuel.SetFocus
    '    Exit Function
    'ElseIf Trim(txtAmount) = "" Then
    '    MandatoryOK = False
    '    MsgBox "Field 'Amount' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
    '    txtAmount.SetFocus
    '    Exit Function
    'ElseIf Trim(txtTime) = "" Then
    '    MandatoryOK = False
    '    MsgBox "Field 'Time' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
    '    txtTime.SetFocus
    '    Exit Function
    'ElseIf Trim(txtGasStation) = "" Then
    '    MandatoryOK = False
    '    MsgBox "Field 'Gas Station' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
    '    txtGasStation.SetFocus
    '    Exit Function
    ElseIf Trim(txtOdometer) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Odometer Reading' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
        txtOdometer.SetFocus
        Exit Function
    End If
    
    'Transaction without details
    If rsDetail.RecordCount = 0 Then
        MandatoryOK = False
        MsgBox "Cannot save transaction without details.", vbInformation, "ComUnion"
        dtgTripTicket.SetFocus
        Exit Function
    End If
    
    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
    Do Until rsDetail.EOF
        If rsDetail.Status = (adRecNew) Or rsDetail.Status = (adRecModified) Then
            If IsNull(rsDetail!cDRNo) Then
                rsDetail.Delete
            ElseIf Trim(rsDetail!cDRNo) = "" Then
                rsDetail.Delete
            Else
                rsDetail.MoveNext
            End If
        Else
            rsDetail.MoveNext
        End If
    Loop

    GetChild

    If rsDetail.RecordCount < 1 Then
        MsgBox "Cannot save transaction without details.", vbExclamation, "ComUnion"
        MandatoryOK = False
        Exit Function
    End If

End Function

'Filter detail recordset to header's primary
Private Sub GetChild()
    rsDetail.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
End Sub

Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtTranNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cTranNo LIKE '" & Trim$(txtTranNo.Text) & "%'"
    End If

    If Trim$(dtbDate.Text) <> "__/__/____" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " dDate = '" & Trim$(dtbDate.Text) & "'"
    End If
    
    If Trim$(txtArea.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cArea LIKE '" & Trim$(txtArea.Text) & "%'"
    End If
    
    If Trim$(txtVanNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cVanNo LIKE '" & Trim$(txtVanNo.Text) & "%'"
    End If
    
    If Trim$(txtDriver.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cDriver LIKE '" & Trim$(txtDriver.Text) & "%'"
    End If
    
    If Trim$(dtbDelivery.Text) <> "__/__/____" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " dDeliveryDate = '" & Trim$(dtbDelivery.Text) & "'"
    End If
    
    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

'Sets the form if record number is zero
Private Sub RSZero()
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    sbRS.Panels(4) = ""
    sbRS.Panels(5) = ""
    
    Set dtgTripTicket.DataSource = Nothing
    dtgTripTicket.Refresh
    
    Set FrmName = Me
    UnbindControls
    TextClearing
    FormLocking True
    
    If rsHeader.State = adStateOpen Then rsHeader.Close
    If rsDetail.State = adStateOpen Then rsDetail.Close
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    
    txtTranNo.Locked = False
    txtTranNo.SetFocus
    
    Mode = Find
    
End Sub

Sub SearchObj(lEnable As Boolean)
    dtbDate.Enabled = lEnable
    dtbDelivery.Enabled = lEnable
    cmdPickCode.Enabled = lEnable
End Sub

Sub CheckDoubleDetails(DRNo As String)
    rsDetail.MovePrevious
    Do While Not rsDetail.BOF
        If rsDetail.EOF Then
            Beep
        Else
            If DRNo = rsDetail!cDRNo And rsDetail.RecordCount > 1 Then
                If Not rsDetail.EOF Then
                    MsgBox "DR No. already exist.", vbCritical + vbOKOnly, "ComUnion"
                    rsDetail.MoveLast
                    TBDeleteLine
                    rsDetail.MoveLast
                    Exit Sub
                End If
            End If
        End If
        rsDetail.MovePrevious
    Loop
    
    If rsDetail.RecordCount > 0 Then
        rsDetail.MoveLast
        dtgTripTicket.Col = 5
        rsDetail!lDelivered = rsDetail!lDelivered
    End If
End Sub

Sub ComputeWeight()
'Dim nGW As Integer
'Dim nNW As Integer
'Dim nQTY As Integer
'Dim nNW As Integer
Dim nGW, nNW, nQty As Integer
    nGW = 0
    nNW = 0
    nQty = 0

    rsDetail.MoveFirst
    Do While Not rsDetail.EOF
        sSQL = "SELECT count(cDelCode) as TotalCustomer," & _
            "isnull(sum(nQTY),0) as nQTY, " & _
            "isnull(sum(nQTY * nGrossWeight), 0) as nGrossWeight, " & _
            "isnull(sum(nQTY * nNetWeight),0) as nNetWeight " & _
            "FROM DR A " & _
            "JOIN DR_T B ON A.cDRNo = b.cDRNo AND A.cCompanyID = B.cCompanyID " & _
            "LEFT OUTER JOIN ITEM C ON B.cItemNo = C.cItemNo AND B.cCompanyID = C.cCompanyID " & _
            "where A.cDRNo = '" & Trim(rsDetail!cDRNo) & "'" & _
            "group by A.cDRNo"
            
        Set rs = New Recordset
        rs.Open sSQL, cn, adOpenKeyset
        If rs.RecordCount > 0 Then
            nQty = nQty + rs!nQty
            nGW = nGW + rs!nGrossWeight
            nNW = nNW + rs!nNetWeight
        End If
        Set rs = Nothing
        rsDetail.MoveNext
    Loop
    
    txtGrossWeight = nGW
    txtNetWeight = nNW
    txtTotalCase = nQty
End Sub

Sub CountItemCustomer()

    sSQL = "select sum(nCustomer) as nCustomer, sum(nProduct) as nProduct " & _
            "from (Select count(distinct cCustomer) as nCustomer, 0 as nProduct from TRIPTICKET_T " & _
            "where cCompanyID = '" & COID & "' and cTranNo = '" & Trim(txtTranNo) & "'" & _
            "union all " & _
            "select 0 as nCustomer, count(distinct cItemNo) " & _
            "from TRIPTICKET_T A " & _
            "join DR_T B on a.cDRNO = b.cDRNo and a.cCompanyID = b.cCompanyID " & _
            "where A.cCompanyID = '" & COID & "' and cTranNo = '" & Trim(txtTranNo) & "'" & _
            ") A "
            
    Set rs = New Recordset
    rs.Open sSQL, cn, adOpenKeyset
    If rs.RecordCount > 0 Then
        txtTotalProduct = rs!nProduct
        txtTotalCustomer = rs!nCustomer
        cn.Execute "UPDATE TRIPTICKET SET nProduct = '" & rs!nProduct & "', nCustomer = '" & rs!nCustomer & "' " & _
                "WHERE cCompanyID = '" & Trim(COID) & "' and cTranNo = '" & Trim(txtTranNo) & "'"
        
    End If
    Set rs = Nothing
End Sub

'Public Sub ShowForm(sTranNo As String)
'    If Mode = Find Then
'
'        OpenNewConnection connHeader
'        OpenNewConnection connDetail
'
'        Set rsHeader = Nothing
'        Set rsDetail = Nothing
'        Set rsHeader = New ADODB.Recordset
'        Set rsDetail = New ADODB.Recordset
'
'        OpenRecordsetWithCN rsDetail, "*", "TRIPTICKET_T", connDetail, "WHERE cTranNo = '" & Trim(sTranNo) & "'"
'        OpenRecordsetWithCN rsHeader, "*", "TRIPTICKET", connHeader, "WHERE cTranNo = '" & Trim(sTranNo) & "'"
'
'        Set FrmName = Me
'        FormLocking True
'
'        If rsHeader.RecordCount = 0 Then
'            FormWaitHide
'            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
'            RSZero
'            FormSearch True
'            SearchObj True
'            Mode = Find
'            Exit Sub
'        End If
'            SetDataSource
'            SetDataField
'            txtTranNo.BackColor = &HE0FFFF
'            Mode = Normal
'            oBar.BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True, True
'
'    End If
'End Sub
